package com.card.match;

import com.card.game.BasePlayer;

public class RankScore implements Comparable<RankScore>{
	private int score;//积分
	private transient String userId;
	
	public RankScore(BasePlayer player) {
		this.userId = player.getUserId();
		this.score = player.getScore();
	}
	public RankScore(String userId) {
		this.userId = userId;
	}
	public void addScore(int add) {
		this.score += add;
	}
	public int getScore() {
		return score;
	}
	public void updateScore(BasePlayer player) {
		this.score = player.getScore();
	}
	
	public String getUserId() {
		return userId;
	}
	@Override
	public int compareTo(RankScore o) {
		return o.score-this.score;
	}
}
